package com.sxz.sbs.module.mine.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.mine.mode.GeneralizeCodeBean;
import com.sxz.sbs.module.mine.view.GeneralizeCodeView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;

/**
 * 扫码送现金 P 层
 * @author hp
 */

public class GeneralizeCodePresenter extends RxPresenter<GeneralizeCodeView>{
    /**
     * 扫码送现金
     */
    public void generalizeCode (HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getGeneralizeCode(map)
                .compose(RxUtil.<GeneralizeCodeBean>handleResult())
                .subscribeWith(new RxSubscriber<GeneralizeCodeBean>(mView,true){
                    @Override
                    public void onNext(GeneralizeCodeBean info) {
                        mView.onGeneralizeCodeSuccess(info);
                    }
                })
        );
    }
}

